package simple;

/**
 * @author 421527548@qq.com
 * @version V1.0
 * @title
 * @description
 * @date 2022-11-14 10:03
 */
public class WeaponFactory extends AbstractFactory {
    /**
    * @Author E-Mail: 421527548@qq.com
    * @Describtion: 静态工厂，需要什么产品就传递什么参数，传递TANK获取坦克
    * @Date: 10:06 2022/11/14
    * @Params:
    * @Return:
    */

    @Override
    public Weapon getWeapon(String type) {
        if(type.equals("BOOM")){
            return new Boom();
        }else if ("FIGHTER".equals(type)){
            return new Fighter();
        }else if ("TANK".equals(type)){
            return new Tank();
        }else {
            throw new RuntimeException("无法生产该武器");
        }
    }

    @Override
    public Food getFood(String foodType) {
        return null;
    }
}
